﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace day6_case1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Student stu1 =new Student();
            //stu1.Name = "zhangsan";
            //stu1.Sex = "女";
            //stu1.Age = 30;
            //stu1.MyClass = "网一班";
            //stu1.SayHello();

            Teacher t1 = new Teacher("Alan","男",45,"机器学习");
            t1.SayHello();
            
        }

        class Student
        {

            public string Name;
            public int Age;
            public string Sex;
            public string MyClass;

            public void SayHello() {
            Console.WriteLine("大家好，我叫"+Name);
            Console.WriteLine("姓别"+Sex);
            Console.WriteLine("我今年" + Age+"岁了");
            Console.WriteLine("我的班级"+MyClass);

            }
        }
        public class Teacher
        {
            public string Name;
            public string Sex;
            public int Age;
            public string Research;
            public Teacher(string name, string sex, int age, string research)
            {
                this.Name = name;
                this.Sex = sex;
                this.Age = age;
                this.Research = research;
            }
             ~Teacher()
            {
                Console.WriteLine("析构函数被调用");

            }
            public void SayHello()
            {
            Console.WriteLine("大家好，我叫" + this.Name);
            Console.WriteLine("姓别" + this.Sex);
            Console.WriteLine("我今年" + Age + "岁了");
            Console.WriteLine("我的研究方向是" + Research);

            }


        }

    }



   
}

